package appconfig

import (
	"fmt"
	"github.com/spf13/viper"
)

type AppConfig struct {
	NaCos struct {
		NamespaceId string
		IpAddr      string
		DataId      string
		Group       string
	}
}

var ViperData AppConfig

func GetViperConfig() {
	viper.SetConfigFile("./appconfig/dev.yaml")
	err := viper.ReadInConfig()
	if err != nil {
		return
	}
	fmt.Println("读取成功")
	err = viper.Unmarshal(&ViperData)
	if err != nil {
		return
	}
	fmt.Println("解析成功")
}
